import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Register from '@/components/Register'
import JsTest from '@/components/test/Jstest'
import VueXTest from '@/components/test/vuexTest'
import Home from '@/components/home/Home'
import Chart from '@/components/home/Chart'
import Mine from '@/components/home/Mine'
import Contracts from '@/components/home/Contracts'
import ChartRoom from '@/components/ChartRoom'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: 'home'
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/jstest',
      name: 'jstest',
      component: JsTest
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: '',
          redirect: 'chart'
        },
        {
          path: 'chart',
          component: Chart
        },
        {
          path: 'mine',
          component: Mine
        },
        {
          path: 'contracts',
          component: Contracts
        },
      ]
    },
    {
      path: '/chartRoom',
      name: 'chartRoom',
      component: ChartRoom
    },
    {
      path: '/vuextest',
      name: 'vuextest',
      component: VueXTest
    }
  ]
})
